var AgxConstruct =
{
    divUnity: '',
    divError: '',
    divShare: '',
    aBtnDownloadUnity: '',    
    divBtnDownloadUnity: '',    
    divContent: '',
    divNotPlugin: '',        
    aBtnShare: '',
    aBtnCancel: '',    
    classFade: '',
    splas: '',
    aBtnSplas: '',
    
    init : function()
    {        
        $(AgxConstruct.aBtnDownloadUnity).click(function(){AgxNotPlugin.downloadPluginUnity()});        
        $(AgxConstruct.aBtnCancel).click(function(){AgxConstruct.hideShare(), AgxConstruct.showUnity()});        
        AgxConstruct.fadeBtn();                
    },        
    
    fadeBtn: function()
    {
        $(AgxConstruct.classFade).append('<span class="hover" />').each(function () 
        {
            var $span = $('> span.hover', this).css('opacity', 0);
            $(this).hover(function () 
            {            
                // on hover
                $span.stop().fadeTo(150, 1);
            }, 
            function () 
            {
                // off hover
                $span.stop().fadeTo(150, 0);
            });
        });
        
    },            
    hideUnity: function()
    {               
        if($("#unityPlayer").length)
        {            
            u3dobject.hide('unityPlayer');
        }       
    },
    
    showUnity: function()
    {
        u3dobject.show('unityPlayer');        
    },
    
    hideShare: function()
    {
        $(AgxConstruct.divShare).hide();        
    },
    
    showShare: function()
    {
        $(AgxConstruct.divShare).css('display', 'inherit');           
    },
    
    showContent: function()
    {
        $(AgxConstruct.divContent).css('display', 'inherit');        
    },
    
    hideContent: function()
    {
        $(AgxConstruct.divContent).hide();
    },
    
    showNotPlugin: function()
    {
        $(AgxConstruct.divNotPlugin).css('display', 'inherit');                
    },
    
    hideNotPlugin: function()
    {
        $(AgxConstruct.divNotPlugin).hide();
    },
    
    
    showError: function()
    {            
		$(AgxConstruct.divUnity).remove();
		$(AgxConstruct.divShare).remove();
		$(divNotPlugin).remove();
        $(AgxConstruct.divError).css('display', 'inherit');            
        
    },            
    
    lancPopUp: function(url)
    {
        var width = 500;
        var height = 400;

        var left = 100;
        var top = 150;

        window.open(url,'Janela','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,width='+width+',height='+height+',top='+top+',left='+left);return false;
        //window.open(url, 'width='+width+', height='+height+', top='+top+', left='+left+', scrollbars=yes, status=no, toolbar=no, location=no, directories=no, menubar=no, resizable=no, fullscreen=no');
    }
}